<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%
request.setCharacterEncoding("utf-8");
String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String rootPath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort();
String item_id=request.getParameter("item_id");
String clobstring=request.getParameter("clobstring");
if (clobstring==null)
{
	clobstring="";
}
%>
<!doctype html>
<html>
<head>
	<base target="_self" />
	<meta charset="utf-8" />
	<meta http-equiv="Pragma" content="No-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="Expires" content="-1">	
	<title>添加新闻</title>
	<script type="text/javascript" charset="utf-8" src="./kindeditor.js"></script>
	<script type="text/javascript">
		KE.show({
			id : 'news_clob1',
			imageUploadJson : '../../jsp/upload_json.jsp',
			fileManagerJson : '../../jsp/file_manager_json.jsp',
			allowFileManager : true,
			afterCreate : function(id) {
				KE.event.ctrl(document, 13, function() {
					KE.util.setData(id);
					document.forms['example'].submit();
				});
				KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
					KE.util.setData(id);
					document.forms['example'].submit();
				});
			}
		});
		
		function add_html()
		{	
		var keval=KE.util.getPureData('news_clob1');
		document.getElementById("news_clob").value=keval;
		var obj=window.confirm("是否要添加本条消息?");
	if(obj==true)
	{
		window.alert("添加新闻");
		document.getElementById("example").submit();
		//window.alert("数据已经提交");
		//window.close();
		}}
	</script>
</head>
<body>
	  
	  <form name="example" id="example" method="post" action="<%=rootPath%>/Ocean/admin_insert_news.do?method=admin_insert_news">
      <table border="0" cellspacing="1" cellpadding="1">
	    <tr>
				<td colspan="2" bgcolor="#eaebe3">
					新闻中心添加
				</td>
			</tr>
	    <tr>
	      <td>标题：</td>
	      <td><input type="text" name="news_title" id="news_title"></td>
        </tr>
	    <tr>
	      <td colspan="2">详细：
          <input type="hidden" name="news_clob" id="news_clob"></td>
        </tr>
	    <tr>
		    <td colspan="2">
		    <textarea id="news_clob1" name="news_clob1" cols="100" rows="8" style="width:650px;height:600px;visibility:hidden;"><%=htmlspecialchars(clobstring)%></textarea></td>
        </tr>
	    <tr>
	      <td colspan="2"><input type="button" name="button" id="button" value=" 提交 "
							onclick="add_html()" /></td>
        </tr>
	  </table>
</form>
<br />

</body>
</html>
<%!
private String htmlspecialchars(String str) {
	str = str.replaceAll("&", "&amp;");
	str = str.replaceAll("<", "&lt;");
	str = str.replaceAll(">", "&gt;");
	str = str.replaceAll("\"", "&quot;");
	return str;
}
%>